import unittest, requests


class MyTestCase(unittest.TestCase):
    host = 'http://10.59.9.18'
    #注册
    @unittest.skip
    def test_01(self):
        url=MyTestCase.host+'/hotNews/user/v1/register'
        json={'userName':"lichengfei","nickName":"辉煌","passwd":"Li123456"}
        r=requests.post(url=url,json=json)
        print(r.json())

    token=None
    userId=None
    def test_02(self):
        url = MyTestCase.host + '/hotNews/user/v1/login'
        json = {"userName": "lichengfei",
                "passwd": "Li123456"}
        r = requests.post(url=url, json=json)
        print(r.json())
        MyTestCase.userId=str(r.json()['result']['userId'])
        MyTestCase.token = r.json()['result']['token']

    #查询我的信息
    def test_03(self):
        url = MyTestCase.host + '/hotNews/user/verify/v1/findMyInfo'
        headers = {"userId": MyTestCase.userId,"token": MyTestCase.token}
        r = requests.get(url=url, headers=headers)
        print(r.json())

    #查询作者详情
    def test_04(self):
        url = MyTestCase.host + '/hotNews/user/v1/findAuthorDetails'
        headers = {"userId": MyTestCase.userId,"token": MyTestCase.token}
        json={"authorId":1}
        r = requests.get(url=url,params=json,headers=headers)
        print(r.json())

    #查询作者发布过的新闻
    def test_05(self):
        url = MyTestCase.host + '/hotNews/user/verify/v1/findAuthorNewsList'
        headers = {"userId": MyTestCase.userId,"token": MyTestCase.token}
        json={"authorId":1,"page":1,"size":5}
        r = requests.get(url=url,json=json,headers=headers)
        print(r.json())

    #查询作者发布过的视频
    def test_06(self):
        url = MyTestCase.host + '/hotNews/user/verify/v1/findAuthorVideoList'
        headers = {"userId": MyTestCase.userId,"token": MyTestCase.token}
        json={"authorId":1,"page":1,"size":5}
        r = requests.get(url=url,json=json,headers=headers)
        print(r.json())

    #修改昵称
    def test_07(self):
        url = MyTestCase.host + '/hotNews/user/verify/v1/modifyNickName'
        headers = {"userId": MyTestCase.userId,"token": MyTestCase.token}
        json={"nickName":"为天地立命"}
        r = requests.put(url=url,json=json,headers=headers)
        print(r.json())

    #修改签名
    def test_08(self):
        url = MyTestCase.host + '/hotNews/user/verify/v1/modifySignature'
        headers = {"userId": MyTestCase.userId,"token": MyTestCase.token}
        json={"signature":"为万世开太平"}
        r = requests.put(url=url,json=json,headers=headers)
        print(r.json())

    #修改生日
    def test_09(self):
        url = MyTestCase.host + '/hotNews/user/verify/v1/modifyBirthday'
        headers = {"userId": MyTestCase.userId,"token": MyTestCase.token}
        json={"birthday":"124219322236129"}
        r = requests.put(url=url,params=json,headers=headers)
        print(r.json())

    #查询我的收藏
    def test_10(self):
        url = MyTestCase.host + '/hotNews/user/verify/v1/findMyCollect'
        headers = {"userId": MyTestCase.userId,"token": MyTestCase.token}
        json={"type":1,"page":1,"size":5}
        r = requests.get(url=url,params=json,headers=headers)
        print(r.json())

    #查询消息通知
    def test_11(self):
        url = MyTestCase.host + '/hotNews/user/verify/v1/findNotice'
        headers = {"userId": MyTestCase.userId, "token": MyTestCase.token}
        json = {"noticeType": 1, "page": 1, "size": 5}
        r = requests.get(url=url, params=json, headers=headers)
        print(r.json())

    #查询关注列表
    def test_12(self):
        url = MyTestCase.host + '/hotNews/user/verify/v1/findMyFocusList'
        headers = {"userId": MyTestCase.userId,"token": MyTestCase.token}
        json={"page":1,"size":5}
        r = requests.get(url=url,params=json,headers=headers)
        print(r.json())

    #查询我的全民拍
    def test_13(self):
        url = MyTestCase.host + '/hotNews/user/verify/v1/findMyShoot'
        headers = {"userId": MyTestCase.userId, "token": MyTestCase.token}
        json = {"type": 1, "page": 1, "size": 5}
        r = requests.get(url=url, params=json, headers=headers)
        print(r.json())

    #回复全民拍评论
    def test_14(self):
        url = MyTestCase.host + '/hotNews/user/verify/v1/replyShootComment'
        headers = {"userId": MyTestCase.userId, "token": MyTestCase.token}
        json = {"shootId": 112, "commentId": 10002, "content": "hhhhhhh"}
        r = requests.get(url=url, params=json, headers=headers)
        print(r.json())

    #查询我的问答
    def test_15(self):
        url = MyTestCase.host + '/hotNews/user/verify/v1/findMyProblem'
        headers = {"userId": MyTestCase.userId, "token": MyTestCase.token}
        json = {"type": 1, "page": 1, "size": 5}
        r = requests.get(url=url, params=json, headers=headers)
        print(r.json())

    #查询我的收货地址列表
    def test_16(self):
        url = MyTestCase.host + '/hotNews/user/verify/v1/findMyShippingAddressList'
        headers = {"userId": MyTestCase.userId, "token": MyTestCase.token}
        r = requests.get(url=url,headers=headers)
        print(r.json())

    #新增收货地址
    def test_17(self):
        url = MyTestCase.host + '/hotNews/user/verify/v1/addShippingAddress'
        headers = {"userId": MyTestCase.userId, "token": MyTestCase.token}
        json={"consignee":"爱情","phone":"17733058407","region":"河北","doorplate":"2011","defaultFlag":2}
        r = requests.post(url=url,json=json, headers=headers)
        print(r.json())

    #修改收货地址
    def test_18(self):
        url = MyTestCase.host + '/hotNews/user/verify/v1/modifyShippingAddress'
        headers = {"userId": MyTestCase.userId, "token": MyTestCase.token}
        json={"consignee":"辉煌世界","phone":"17733058407","region":"河北邯郸","doorplate":"2060","defaultFlag":2}
        r = requests.put(url=url,json=json, headers=headers)
        print(r.json())

    #查询默认收货地址
    def test_19(self):
        url = MyTestCase.host + '/hotNews/user/verify/v1/findDefaultAddress'
        headers = {"userId": MyTestCase.userId, "token": MyTestCase.token}
        r = requests.get(url=url,headers=headers)
        print(r.json())

    #删除收货地址
    def test_20(self):
        url = MyTestCase.host + '/hotNews/user/verify/v1/deleteAddress'
        headers = {"userId": MyTestCase.userId, "token": MyTestCase.token}
        r = requests.delete(url=url,headers=headers)
        print(r.json())

    #查询浏览历史记录
    def test_21(self):
        url = MyTestCase.host + '/hotNews/user/verify/v1/findBrowsingHistory'
        headers = {"userId": MyTestCase.userId, "token": MyTestCase.token}
        json={"page":1,"size":5}
        r = requests.get(url=url,params=json,headers=headers)
        print(r.json())

    #清空浏览历史记录
    def test_22(self):
        url = MyTestCase.host + '/hotNews/user/verify/v1/emptyHistory'
        headers = {"userId": MyTestCase.userId, "token": MyTestCase.token}
        r = requests.get(url=url,headers=headers)
        print(r.json())

    #意见反馈
    def test_23(self):
        url = MyTestCase.host + '/hotNews/user/verify/v1/feedback'
        headers = {"userId": MyTestCase.userId, "token": MyTestCase.token}
        json={"content":"gfgggg"}
        r = requests.post(url=url,data=json,headers=headers)
        print(r.json())

    #查询我的金币余额
    def test_24(self):
        url = MyTestCase.host + '/hotNews/user/verify/v1/findMyGoldBalance'
        headers = {"userId": MyTestCase.userId, "token": MyTestCase.token}
        r = requests.get(url=url,headers=headers)
        print(r.json())

    #查询我的签到状态
    def test_25(self):
        url = MyTestCase.host + '/hotNews/user/verify/v1/findMyGoldBalance'
        headers = {"userId": MyTestCase.userId, "token": MyTestCase.token}
        r = requests.get(url=url,headers=headers)
        print(r.json())

    #查询任务列表
    def test_26(self):
        url = MyTestCase.host + '/hotNews/user/verify/v1/findMyTaskList'
        headers = {"userId": MyTestCase.userId, "token": MyTestCase.token}
        r = requests.get(url=url, headers=headers)
        print(r.json())

    #签到
    def test_27(self):
        url = MyTestCase.host + '/hotNews/user/verify/v1/userSign'
        headers = {"userId": MyTestCase.userId, "token": MyTestCase.token}
        r = requests.put(url=url, headers=headers)
        print(r.json())

    #做任务
    def test_28(self):
        url = MyTestCase.host + '/hotNews/user/verify/v1/doTheTask'
        headers = {"userId": MyTestCase.userId, "token": MyTestCase.token}
        json={"taskNumber":1}
        r = requests.put(url=url,data=json,headers=headers)
        print(r.json())

    #领金币
    def test_29(self):
        url = MyTestCase.host + '/hotNews/user/verify/v1/receiveGold'
        headers = {"userId": MyTestCase.userId, "token": MyTestCase.token}
        json={"taskNumber":1}
        r = requests.put(url=url,data=json,headers=headers)
        print(r.json())

    #查询我的金币消费明细
    def test_30(self):
        url = MyTestCase.host + '/hotNews/user/verify/v1/findMyGoldConsumerDetails'
        headers = {"userId": MyTestCase.userId, "token": MyTestCase.token}
        json={"type":1}
        r = requests.get(url=url,data=json,headers=headers)
        print(r.json())

    #绑定极光token
    def test_31(self):
        url = MyTestCase.host + '/hotNews/user/verify/v1/bindJiGuangToken'
        headers = {"userId": MyTestCase.userId, "token": MyTestCase.token}
        json={"jiGuangToken":"极光的RegistrationID"}
        r = requests.post(url=url,data=json,headers=headers)
        print(r.json())

    #查看健康跑步领取状态
    def test_32(self):
        url = MyTestCase.host + '/hotNews/user/verify/v1/bindJiGuangToken'
        headers = {"userId": MyTestCase.userId, "token": MyTestCase.token}
        r = requests.get(url=url,headers=headers)
        print(r.json())

    #领取健康跑步奖励
    def test_33(self):
        url = MyTestCase.host + '/hotNews/user/verify/v1/receiveHealthReward'
        headers = {"userId": MyTestCase.userId, "token": MyTestCase.token}
        r = requests.put(url=url,headers=headers)
        print(r.json())

    #查询商城商品列表
    def test_34(self):
        url = MyTestCase.host + '/hotNews/mall/v1/findProductList'
        json = {"page": 1, "size": 5}
        r = requests.get(url=url,params=json)
        print(r.json())

    #查询商品详情
    def test_35(self):
        url = MyTestCase.host + '/hotNews/mall/v1/findProductDetail'
        json = {"productId": 1}
        r = requests.get(url=url,params=json)
        print(r.json())

    #查询兑换记录
    def test_36(self):
        url = MyTestCase.host + '/hotNews/mall/verify/v1/findExchangeRecord'
        headers = {"userId": MyTestCase.userId, "token": MyTestCase.token}
        json = {"page": 1, "size": 5}
        r = requests.get(url=url,params=json,headers=headers)
        print(r.json())

    #查询问答列表
    def test_37(self):
        url = MyTestCase.host + '/hotNews/problem/v1/findProblemList'
        json = {"page": 1, "size": 5}
        r = requests.get(url=url,params=json)
        print(r.json())

    #查询问题的回答列表
    def test_38(self):
        url = MyTestCase.host + '/hotNews/problem/v1/findAnswerList'
        json = {"problemId":1,"page": 1, "size": 5}
        r = requests.get(url=url,params=json)
        print(r.json())

    #查询回答的评论列表
    def test_39(self):
        url = MyTestCase.host + '/hotNews/problem/v1/findAnswerCommentList'
        json = {"problemId":1,"page": 1, "size": 5}
        r = requests.get(url=url,params=json)
        print(r.json())

    #回答
    def test_40(self):
        url = MyTestCase.host + '/hotNews/problem/verify/v1/answer'
        headers = {"userId": MyTestCase.userId, "token": MyTestCase.token}
        json = {"problemId":1,"content":"好"}
        r = requests.post(url=url,data=json,headers=headers)
        print(r.json())

    #评论
    def test_41(self):
        url = MyTestCase.host + '/hotNews/problem/verify/v1/publishComment'
        headers = {"userId": MyTestCase.userId, "token": MyTestCase.token}
        json = {"answerId":1,"content":"好"}
        r = requests.post(url=url,params=json,headers=headers)
        print(r.json())

    #点赞回答
    def test_42(self):
        url = MyTestCase.host + '/hotNews/problem/verify/v1/praiseAnswer'
        headers = {"userId": MyTestCase.userId, "token": MyTestCase.token}
        json = {"answerId":1}
        r = requests.put(url=url,params=json,headers=headers)
        print(r.json())

    #问答搜索
    def test_43(self):
        url = MyTestCase.host + '/hotNews/problem/v1/search'
        json = {"keyword": "5G", "page": 1, "size": 5}
        r = requests.get(url=url,params=json)
        print(r.json())

    #查询全民拍列表
    def test_44(self):
        url = MyTestCase.host + '/hotNews/shoot/v1/findShootList'
        json = {"typeId": 101, "page": 1, "size": 5}
        r = requests.get(url=url,params=json)
        print(r.json())

    #/hotNews/shoot/v1/findTypeList
    def test_45(self):
        url = MyTestCase.host + '/hotNews/shoot/v1/findShootList'
        r = requests.get(url=url)
        print(r.json())

    #查询全民拍详情
    def test_46(self):
        url = MyTestCase.host + '/hotNews/shoot/v1/findShootDetail'
        headers = {"userId": MyTestCase.userId, "token": MyTestCase.token}
        json={"shootId":5}
        r = requests.get(url=url,params=json,headers=headers)
        print(r.json())

    #查询全民拍评论列表
    def test_47(self):
        url = MyTestCase.host + '/hotNews/shoot/v1/findShootCommentList'
        headers = {"userId": MyTestCase.userId, "token": MyTestCase.token}
        json={"shootId":1001,"page":1,"size":5}
        r = requests.get(url=url,params=json,headers=headers)
        print(r.json())

    #发表全民拍评论
    def test_48(self):
        url = MyTestCase.host + '/hotNews/shoot/v1/findShootCommentList'
        headers = {"userId": MyTestCase.userId, "token": MyTestCase.token}
        json={"shootId":12,"content":"我是一条特别棒的评论内容"}
        r = requests.get(url=url,params=json,headers=headers)
        print(r.json())

    #点赞全民拍的评论
    def test_49(self):
        url = MyTestCase.host + '/hotNews/shoot/verify/v1/praiseShootComment'
        headers = {"userId": MyTestCase.userId, "token": MyTestCase.token}
        json={"commentId":12}
        r = requests.put(url=url,params=json,headers=headers)
        print(r.json())

    #取消点赞全民拍的评论
    def test_50(self):
        url = MyTestCase.host + '/hotNews/shoot/verify/v1/cancelPraise'
        headers = {"userId": MyTestCase.userId, "token": MyTestCase.token}
        json={"commentId":12}
        r = requests.delete(url=url,params=json,headers=headers)
        print(r.json())

    #查询视频频道列表
    def test_51(self):
        url = MyTestCase.host + '/hotNews/video/v1/findColumnList'
        r = requests.get(url=url)
        print(r.json())

    #根据频道查询视频列表
    def test_52(self):
        url = MyTestCase.host + '/hotNews/video/v1/findVideoList'
        headers = {"userId": MyTestCase.userId, "token": MyTestCase.token}
        json={"columnId":1001,"page":1,"size":5}
        r = requests.get(url=url,params=json,headers=headers)
        print(r.json())

    #查询视频弹幕
    def test_53(self):
        url = MyTestCase.host + '/hotNews/video/v1/findVideoBarrage'
        json={"videoId":1001,"page":1,"size":5}
        r = requests.get(url=url,params=json)
        print(r.json())

    #查询视频评论列表
    def test_54(self):
        url = MyTestCase.host + '/hotNews/video/v1/findVideoCommentList'
        json = {"videoId": 1001, "page": 1, "size": 5}
        r = requests.get(url=url, params=json)
        print(r.json())

    #收藏视频
    def test_55(self):
        url = MyTestCase.host + '/hotNews/video/verify/v1/collectVideo'
        headers = {"userId": MyTestCase.userId, "token": MyTestCase.token}
        json = {"videoId": 1001}
        r = requests.put(url=url, params=json,headers=headers)
        print(r.json())

    #取消收藏视频
    def test_56(self):
        url = MyTestCase.host + '/hotNews/video/verify/v1/cancelCollectVideo'
        headers = {"userId": MyTestCase.userId, "token": MyTestCase.token}
        json = {"videoId": 1001}
        r = requests.delete(url=url, params=json,headers=headers)
        print(r.json())

    #查询新闻资讯详情
    def test_57(self):
        url = MyTestCase.host + '/hotNews/news/v1/findNewsDetail'
        headers = {"userId": MyTestCase.userId, "token": MyTestCase.token}
        json = {"newsId": 1001}
        r = requests.get(url=url, params=json,headers=headers)
        print(r.json())

    #购买付费新闻
    def test_58(self):
        url = MyTestCase.host + '/hotNews/news/verify/v1/buyNews'
        headers = {"userId": MyTestCase.userId, "token": MyTestCase.token}
        json = {"newsId": 1}
        r = requests.post(url=url, params=json,headers=headers)
        print(r.json())

    #查询新闻正文内容(不含富文本元素)
    def test_59(self):
        url = MyTestCase.host + '/hotNews/news/v1/findNewsContent'
        headers = {"userId": MyTestCase.userId, "token": MyTestCase.token}
        json = {"newsId": 1}
        r = requests.get(url=url, params=json,headers=headers)
        print(r.json())

    #查询资讯评论列表
    def test_60(self):
        url = MyTestCase.host + '/hotNews/news/v1/findNewsCommentList'
        headers = {"userId": MyTestCase.userId, "token": MyTestCase.token}
        json = {"newsId": 1,"page":1,"size":5}
        r = requests.get(url=url, params=json,headers=headers)
        print(r.json())

    #查询评论回复列表
    def test_61(self):
        url = MyTestCase.host + '/hotNews/news/v1/findCommentReplyList'
        headers = {"userId": MyTestCase.userId, "token": MyTestCase.token}
        json = {"commentId": 1,"page":1,"size":5}
        r = requests.get(url=url, params=json,headers=headers)
        print(r.json())

    #发表评论
    def test_62(self):
        url = MyTestCase.host + '/hotNews/news/verify/v1/publishComment'
        headers = {"userId": MyTestCase.userId, "token": MyTestCase.token}
        json = {"newsId": 11,"content":"我是一条特别棒的评论内容	"}
        r = requests.get(url=url, params=json,headers=headers)
        print(r.json())

    #点赞新闻资讯
    def test_63(self):
        url = MyTestCase.host + '/hotNews/news/verify/v1/praiseNews'
        headers = {"userId": MyTestCase.userId, "token": MyTestCase.token}
        json = {"newsId": 11}
        r = requests.put(url=url, params=json,headers=headers)
        print(r.json())

    #点赞新闻评论
    def test_64(self):
        url = MyTestCase.host + '/hotNews/news/verify/v1/praiseNewsComment'
        headers = {"userId": MyTestCase.userId, "token": MyTestCase.token}
        json = {"commentId": 11}
        r = requests.put(url=url, params=json,headers=headers)
        print(r.json())

    #关注
    def test_65(self):
        url = MyTestCase.host + '/hotNews/news/verify/v1/focusAuthor'
        headers = {"userId": MyTestCase.userId, "token": MyTestCase.token}
        json = {"authorId": 12}
        r = requests.put(url=url, params=json,headers=headers)
        print(r.json())

    #取消关注
    def test_66(self):
        url = MyTestCase.host + '/hotNews/news/verify/v1/cancelFocusAuthor'
        headers = {"userId": MyTestCase.userId, "token": MyTestCase.token}
        json = {"authorId": 12}
        r = requests.delete(url=url, params=json, headers=headers)
        print(r.json())

    #收藏新闻资讯
    def test_67(self):
        url = MyTestCase.host + '/hotNews/news/verify/v1/collectNews'
        headers = {"userId": MyTestCase.userId, "token": MyTestCase.token}
        json = {"newsId": 12}
        r = requests.put(url=url, params=json,headers=headers)
        print(r.json())

    #取消收藏资讯
    def test_68(self):
        url = MyTestCase.host + '/hotNews/news/verify/v1/cancelCollectNews'
        headers = {"userId": MyTestCase.userId, "token": MyTestCase.token}
        json = {"newsId": 12}
        r = requests.delete(url=url, params=json,headers=headers)
        print(r.json())

    #查询banner展示列表
    def test_69(self):
        url = MyTestCase.host + '/hotNews/news/v1/findBannerList'
        r = requests.get(url=url)
        print(r.json())

    #查询频道新闻资讯列表 /hotNews/news/v1/findColumnNewsList
    def test_70(self):
        url = MyTestCase.host + '/hotNews/news/v1/findColumnNewsList'
        json = {"columnId": 1,"page":1,"size":5}
        r = requests.delete(url=url, params=json)
        print(r.json())

    #查询频道列表
    def test_71(self):
        url = MyTestCase.host + '/hotNews/news/v1/findColumnList'
        headers = {"userId": MyTestCase.userId, "token": MyTestCase.token}
        r = requests.delete(url=url,headers=headers)
        print(r.json())


#执行
if __name__ == '__main__':
    unittest.main()
